package com.geek.spring.bean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @program week05
 * @description: xml 装配
 * @author: chanzhugang
 * @create: 2021/04/18 16:43
 */
public class XmlBeanMain {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        CompactDisc compactDisc = (CompactDisc) context.getBean("compactDisc");
        CDPlayer cdPlayer = (CDPlayer) context.getBean("cDPlayer");

        String str = "xml playing ";
        compactDisc.play(str);
        cdPlayer.play(str);

    }
}